import request from '@/config/axios'

// 任务 API
export const ChairmanApi = {
  // 查询任务分页
  getChairmanList: async (data) => {
    return await request.post({ url: `/task/chairman/list`, data })
  },

  // 查询任务详情
  getChairman: async (id) => {
    return await request.get({ url: `/task/chairman/get?id=` + id })
  },

  // 新增任务
  createChairman: async (data) => {
    return await request.post({ url: `/task/chairman/create`, data })
  },

  // 修改任务
  updateChairman: async (data) => {
    return await request.put({ url: `/task/chairman/update`, data })
  },

  // 进展更新
  updateExplanationChairman: async (data) => {
    return await request.put({ url: `/task/chairman/update/explanation`, data })
  },


  putUpChairman: async (id) => {
    return await request.get({ url: `/task/chairman/putUp?id=` + id  })
  },

  putDownChairman :async(id) =>{
    return await request.get({ url: `/task/chairman/putDown?id=` + id  })
  },

  // 删除任务
  deleteChairman: async (id) => {
    return await request.delete({ url: `/task/chairman/delete?id=` + id })
  },

  // 导出任务 Excel
  exportChairman: async (data) => {
    return await request.downloadPost({ url: `/task/chairman/export-excel`, data })
  },
  updateMilestone: async (data) => {
    return await request.put({ url: `/task/dynamic-record/update/milestone`, data })
  },
  // 导出动态任务 Excel
  exportChairmanExcel: async (data) => {
    return await request.downloadPost({ url: `/task/dynamic-record/export-excel`, data })
  },
 // 任务迁移
 replacementChairman: async (data) => {
    return await request.post({ url: `/task/chairman/replacement`, data })
  },
}
